package architect.springcloud.service.provider;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;

/**
 * 服务提供者Controller
 *
 * @author guanxin
 * @date 2018/4/11 9:40
 */

@RestController
@Slf4j
public class ProviderController {

    @GetMapping("/sendMessage")
    public String sendMessage(@RequestParam String message) {
        log.info("Call sendMessage, param message = {}", message);
        return "Hello, Send message " + message + " (from Spring Boot) " + LocalDateTime.now().toString();
    }

    @RequestMapping(value = "/sendSms", method = RequestMethod.POST)
    public String sendSms(@RequestParam String content) {
        log.info("Call sendSms, param content = {}", content);
        return "Hello, Send sms " + content + " (from Spring Boot) " + LocalDateTime.now().toString();
    }
}